"use strict";
cc._RF.push(module, '8c505cE0QVKe4YlNezevpXs', 'gamePrefabMgr');
// Script/SdkTools/gamePrefabMgr.ts

"use strict";
/**
 * 资源管理
 * 涉及到ui,prefab ，音效等资源可以在这里预加载
 *
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.soundName = exports.uiPreName = void 0;
var uiPreName;
(function (uiPreName) {
    uiPreName["addEngry"] = "addEngry";
    uiPreName["addGold"] = "addGold";
    uiPreName["addTiShi"] = "addTiShi";
    //GameOver = 'GameOver',          //游戏over
    uiPreName["timeOver"] = "timeOver";
    uiPreName["selectkuang"] = "selectkuang";
    uiPreName["cha"] = "cha";
    uiPreName["texiao"] = "texiao";
    uiPreName["pausepanel"] = "pausepanel";
    uiPreName["checkoutPanel"] = "checkoutPanel";
    uiPreName["check_item0"] = "check_item0";
    uiPreName["check_item1"] = "check_item1";
    uiPreName["check_item2"] = "check_item2";
    uiPreName["check_item3"] = "check_item3";
})(uiPreName = exports.uiPreName || (exports.uiPreName = {}));
var soundName;
(function (soundName) {
    // game_bg0 = 'game_bg0',        //主音乐
    // game_bg1 = 'game_bg1',
    // game_bg2 = 'game_bg2',
    // game_bg3 = 'game_bg3',
    soundName["main_bg"] = "main_bg";
    soundName["answerright"] = "answerright";
    soundName["error"] = "error";
    soundName["fail"] = "fail";
    soundName["win"] = "win";
    soundName["hit"] = "hit";
    soundName["click"] = "click";
})(soundName = exports.soundName || (exports.soundName = {}));
var gamePrefabMgr = /** @class */ (function () {
    function gamePrefabMgr() {
        this.jilv = 0;
        this.allResNum = 0;
        this.uiPre = [];
        this.soundRes = [];
    }
    Object.defineProperty(gamePrefabMgr, "Instance", {
        get: function () {
            if (null == this.__instance) {
                this.__instance = new gamePrefabMgr();
            }
            return this.__instance;
        },
        enumerable: false,
        configurable: true
    });
    gamePrefabMgr.prototype.Initial = function () {
        //this.isloadOver = !1
        this.jilv = 0;
        var self = this;
        //ui数量
        for (var key in uiPreName) {
            if (Object.prototype.hasOwnProperty.call(uiPreName, key)) {
                this.allResNum++;
            }
        }
        //音效资源数
        for (var key in soundName) {
            if (Object.prototype.hasOwnProperty.call(soundName, key)) {
                this.allResNum++;
            }
        }
        var _loop_1 = function (key) {
            if (Object.prototype.hasOwnProperty.call(uiPreName, key)) {
                var uiname_1 = uiPreName[key];
                cc.resources.load('prefab/Ui/' + uiname_1, cc.Prefab, function (err, assert) {
                    if (err)
                        return console.log('err=', err);
                    self.jilv++;
                    gamePrefabMgr.Instance.uiPre[uiname_1] = assert;
                });
            }
        };
        //加载ui
        for (var key in uiPreName) {
            _loop_1(key);
        }
        var _loop_2 = function (key) {
            if (Object.prototype.hasOwnProperty.call(soundName, key)) {
                var uiname_2 = soundName[key];
                cc.resources.load('Sound/' + uiname_2, function (err, assert) {
                    if (err)
                        return console.log('err=', err);
                    self.jilv++;
                    gamePrefabMgr.Instance.soundRes[uiname_2] = assert;
                });
            }
        };
        //加载音乐
        for (var key in soundName) {
            _loop_2(key);
        }
    };
    return gamePrefabMgr;
}());
exports.default = gamePrefabMgr;

cc._RF.pop();